<%
   case params[:id]
       when "1"
           @type = "article"
           @partial = "contents_list"
           @do = "Create Article"
       when  "2"
           #@partial = "contents_list"
       when "3"
       when "4"
       when "5"
           @type = "question"
           @partial = "forum"
           @do = "Post a question"
       else
           @partial = "contents_list"
   end
%>
<div>
  <% if logged_in? -%>
      <%= link_to @do, :action => "manage_article", :id => params[:id] %>
      <% if @edit_flag && @type =="article" %>
          |  <%= link_to "Administer Articles", :controller => :content, :action => :showArticleApproval %>
      <% end %>
      <% if @edit_flag %>
          |  <%= link_to "Administer " + @type + " categories", :controller => :content, :action => :manage_article_category, :id=> @contypeid %>
      <% end %>
  <% end -%>
</div>
<p>
<div>
  <% form_tag({:controller => "content", :action => "index", :id => params[:id], :page => 1}, :method => "post") do %>
      <%= render :partial => "category_field_row" %>
      <%= render :partial => "search_field_row" %>
      <%= submit_tag("Search", :name => "search") %>
  <% end %>
</div>
</p>

<p>
  <% if logged_in?%>
  <%else%>

  <%end%>
<div id="table_content">
  <%= render :partial => @partial%>
</div>
</p>

<p>
<div>
  <%= will_paginate @contents, :params => {:id => params[:id], :selCategory => params[:selCategory], :schTitle => params[:schTitle]} %>
</div>
</p>